<?php
	session_start();
	//include("config.inc.php");
	include("dbconnect.inc.php");
	$id = $_GET["id"];
	if(!is_numeric($id)) die("id错误");
	$res = mysql_query("select * from news where news_id={$id}");
	$row = mysql_fetch_array($res);
	$title = $row["title"];
	$content = $row["content"];
	$pubtime = $row["pubtime"];
	$sender = $row["sender"];
	include("header.inc.php");
?>
<script language="javascript">
	function doDel(title,id,ref) {
		ref='<?php echo $_SERVER['HTTP_REFERER']; ?>';
		if(confirm('你确定要删除新闻\n-------------------------\n'+title+'\n-------------------------'))
			location.href='admin_editnews.php?del='+id+'&ref='+ref;
	}
</script>
 <table width="778" border="0" cellpadding="0" cellspacing="6" class="border">
  <tr> 
    <td valign="top" width="100%" class="listcontent" align="center"> 
      <table width="100%" border="0" cellpadding="6" cellspacing="0">
        <tr> 
          <td class="listTitle"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td><strong><?php echo $title; ?></strong></td><td align=right>&nbsp;</td>
                </tr>
            </table>
          </td>
        </tr>
        <tr> 
          <td valign="top" class="list"> 
<?php echo $content; ?>
<br />
          </td>
        </tr>
      </table>
    </td>
  </tr>
        <tr> 
          <td class="listTitle"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td>发布者：<?php echo $sender; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    				发布时间：<?php echo $pubtime; ?></td>
    			<td align=right>
<?php if($_SESSION["admin"]) { ?>
<input type="button" value="编　　辑" 
 onclick="location.href='admin_editnews.php?id=<?php echo $id; ?>';" />&nbsp;&nbsp;
<input type="button" value="删　　除"  
	 onclick="doDel('<?php echo $title; ?>','<?php echo $id; ?>');"   />
<?php } ?>&nbsp;
    			</td>

                </tr>
            </table>
          </td>
        </tr>
</table>
<?php include("footer.inc.php"); ?>